(defun div6kp (n)
    (loop for x from 1 to (floor (/ (sqrt n) 6))
     when (not (or (= (mod n (+ (* 6 x) 1)) 0) (= (mod n (- (* 6 x) 1)) 0)))
		do
        (return-from div6kp T))
	 T)

(defun primep (n)
    ( cond
    ((= (mod n 2) 0) nil )
    ((= (mod n 3) 0) nil )
    ((div6kp n) nil )
	(T T)))

